/**
 * 函数节流
 * @param {Function} fn
 * @param {Number} wait
 * @returns
 */
export function throttle(fn, wait) {
  let start = 0
  return function (...args) {
    let now = Date.now()
    if (now - start > wait) {
      fn.call(this, ...args)
      start = now
    }
  }
}
